package com.javagi;

import com.javagi.feign.RemoteClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author kuiwang
 * @Date 2020/4/24 14:15
 * @Version 1.0
 */
@RestController
@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
public class NacosFeignApplication {
    public static void main(String[] args) {
        SpringApplication.run(NacosFeignApplication.class, args);
    }

    @Autowired
    private RemoteClient remoteClient;

    @GetMapping("/feign")
    public String test() {
        String helloNacos = remoteClient.helloNacos();
        return "NacosFeignApplicatoin: " + helloNacos;
    }
}